import java.util.Random;
import java.util.Scanner;
public class Table {

	/**
	 * @param args
	 * Math.pow(2,3)
	 */
	public static void main(String[] args) {
		Scanner input= new Scanner(System.in);
		int x;
		int y;
		int prnt;
		System.out.println("What is the length of the X dimension of your table?");
		x=input.nextInt();
		System.out.println("What is the length of the Y dimension of your table?");
		y=input.nextInt();
		int[][] table=new int[x+1][y+1];
		for (int i=7;i<x+1;i++){
			for (int j=7;j<y+1;j++){
				prnt=(int) Math.pow(i,j);
				table[i][j]=prnt;
				System.out.print(" "+table[i][j]+" ");
			}
			System.out.println();
		}
	}

}
